package org.nimi317.web_gis.form.post;

import jakarta.validation.Valid;
import jakarta.validation.constraints.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import java.util.List;

/**
 * @author thunderobot
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ModelPost {

    //模型名称
    @NotBlank(message = "模型名称不能为空")
    @Length(max = 255, message = "模型名称长度不能超过255")
    private String name;

    //时间滑窗范围
    @NotNull(message = "时间滑窗范围不能为空")
    private Integer featureStep;

    //标签时间步长
    @NotNull(message = "标签时间步长不能为空")
    private Integer labelStep;

    @NotNull(message = "测试集比例不能为空")
    @Max(value = 1, message = "测试集比例不能超过1")
    @Min(value = 0, message = "测试集比例不能小于0")
    private Float testRate;

    //迭代次数
    @NotNull(message = "迭代次数不能为空")
    private Integer epoch;

    //微批次大小
    @NotNull(message = "微批次大小不能为空")
    private Integer batchSize;

    @NotNull(message = "特征开始列不能为空")
    private Integer featureStart;

    @NotNull(message = "特征结束列不能为空")
    private Integer featureStop;

    @NotNull(message = "标签开始列不能为空")
    private Integer labelStart;

    @NotNull(message = "标签结束列不能为空")
    private Integer labelStop;

    //是否使用时间窗口
    @NotNull(message = "是否使用时间窗口？")
    private Boolean timeWindow;

    @NotNull(message = "跳过行数不能为空")
    @Min(value = 0, message = "跳过行数不能小于0")
    private Integer skip;

    @NotNull(message = "请选择归一化或者标准化数据")
    private Boolean standard;

    @NotEmpty(message = "LSTM参数不能为空")
    @Valid
    private List<LstmPost> lstm;
}
